/**
 * TopBarActivity.java
 * com.jamin.topbar
 *
 * Function： TODO 
 *
 *   ver     date      		author
 * ──────────────────────────────────
 *   		 2012-8-4 		wangjieming
 *
 * Copyright (c) 2012, TNT All Rights Reserved.
 */

package com.jamin.custom_view_topbar_path;

import com.jamin.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.widget.TextView;

/**
 * ClassName:TopBarActivity
 *
 * @author   wangjieming
 * @version  1.0
 * @since    v1.0
 * @Date	 2012-8-4 上午8:37:10 
 */
public class TopBarActivity extends Activity{

	TopBar topBar = null;
	TextView tv = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.top_bar_activity);
		topBar = (TopBar) findViewById(R.id.top_bar);
		tv = (TextView) findViewById(R.id.top_bar_text);
		topBar.setTopBarClickListener(new TopBarClickListener() {

			@Override
			public void rightBtnClick() {
				topBar.setTitle("click right btn");
			}

			@Override
			public void leftBtnClick() {
				topBar.setTitle("click left btn");
			}
		});
		String str =  "topBar.setTopBarClickListener(new TopBarClickListener() {\n" + 
				"\t\t@Override \n" + 
				"\t\tpublic void rightBtnClick() {\n" +
				"\t\t\ttopBar.setTitle(\"click right btn\");\n" + 
				"\t\t}\n" + 
				"\t\t@Override \n" + 
				"\t\tpublic void leftBtnClick() {\n" + 
				"\t\t\ttopBar.setTitle(\"click left btn\");\n" + 
				"\t\t}\n" + 
				"});\n\n";
		str += "-------------------------------------\n";
		str +=  "<com.jamin.custom_view_topbar_path.TopBar\n" + 
				"\tandroid:id=\"@+id/top_bar\"\n" +
				"\tandroid:layout_width=\"fill_parent\"\n" + 
				"\tandroid:layout_height=\"wrap_content\"\n" + 
				"\tandroid:background=\"@drawable/title_bg\"\n" + 
				"\tcustom:leftBackground=\"@drawable/selector_title_back\"\n" + 
				"\tcustom:rightBackground=\"@drawable/selector_title_back\"\n" + 
				"\tcustom:title=\"自定义标题\"\n" + 
				"\tcustom:titleTextColor=\"#ffffff\"\n" + 
				"\tcustom:titleTextSize=\"15.0sp\" />\n";

		tv.setText(str);


	}








}

